#include <stdio.h>
#include <stdlib.h>

void test1 (void)
{
	int a = 9,b  = 10;
	/*
 	* 知识缺口: ++ --> b++ < a ==> b < a; b++
 	* */
	if (b++ < a)
	{
		printf("1\n");

	}else{

		printf("0\n");

	}
	printf("a = %d,b = %d",a,b);
	
	return;	
}
/*
 *
 *++的小练习  
 * */
void test1_1(void)
{
	int a = 9,b  = 10;
	printf("%d\n",(++b<a , ++a , b++));
	printf("a = %d , b = %d\n",a,b);
	return;
}
/*
 * score [90-100] A
 * 	 [80-90)  B
 * 	 [70-80)  C
 * 	 [60-70)  D
 * 	 [0-60)   E
 * */
void test1_exec_score(void)
{
	int score;
	printf("Enter a score:[0-100]:\n");
	scanf("%d",&score);
	if (score < 0 || score >100)
	{
		fprintf(stderr,"input error!\n");	
		exit(1);
	}

	if(score > 90)
		puts("A");
	else if (score > 80)
		puts("B");
	else if (score>70)
		puts("C");	
	else if (score > 60)
		puts("D");
	else 
		puts("E");				


/*	
 *	if (score < 0 || score >100)
	{
		fprintf(stderr,"input error!\n");	
		exit(1);

	}else
	{
		if (score <= 100 && score >=90)
			puts("A");	
		if (score < 90 && score >=80)
			puts("B");	
		if (score < 80 && score >= 70)
			puts("C");	
		if (score < 70 && score >=60)
			puts("D");	
		if (score <60 && score >= 0)
			puts("E");	

	}

*/
}

/*
 *判断润年 能被4整除但是不能被100整除 或能被400整除
 * */
void test1_exec_year(void)
{

	int year;
	printf("plz enter year：\n");
	scanf("%d",&year);
	if (year %4==0&&year%100 !=0 ||year%400 == 0)
	{
		printf("%d是润年",year);

	}


}



int main(void)
{

	test1();

	test1_exec_year();


	exit(0);
}

